Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: FFmpeg/FFmpeg
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bd03afb5bb48
Choose a base ref
...
head repository: FFmpeg/FFmpeg
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ea7b96af961e
Choose a head ref
  • 4 commits
  • 4 files changed
  • 2 contributors

Commits on Mar 26, 2013

  1. Copy the full SHA
    e600d06 View commit details
  2. lavfi/perms: add seed option.

    ubitux committed Mar 26, 2013
    Copy the full SHA
    9371467 View commit details
  3. Copy the full SHA
    e32cbd0 View commit details
  4. avcodec/x86/dsputil_qns_template: use av_assert

    Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
    michaelni committed Mar 26, 2013
    Copy the full SHA
    ea7b96a View commit details
Showing with 24 additions and 18 deletions.
  1. +6 −0 doc/filters.texi
  2. +1 −1 libavcodec/x86/dsputil_qns_template.c
  3. +16 −16 libavfilter/f_perms.c
  4. +1 −1 libavfilter/version.h
6 changes: 6 additions & 0 deletions doc/filters.texi
Original file line number Diff line number Diff line change
@@ -6249,6 +6249,12 @@ Make the frame read-only if writable, and writable if read-only.
@item random
Set each output frame read-only or writable randomly.
@end table

@item seed
Set the seed for the @var{random} mode, must be an integer included between
@code{0} and @code{UINT32_MAX}. If not specified, or if explicitly set to
@code{-1}, the filter will try to use a good random seed on a best effort
basis.
@end table

Note: in case of auto-inserted filter between the permission filter and the
2 changes: 1 addition & 1 deletion libavcodec/x86/dsputil_qns_template.c
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ static int DEF(try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[
{
x86_reg i=0;

assert(FFABS(scale) < MAX_ABS);
av_assert2(FFABS(scale) < MAX_ABS);
scale<<= 16 + SCALE_OFFSET - BASIS_SHIFT + RECON_SHIFT;

SET_RND(mm6);
32 changes: 16 additions & 16 deletions libavfilter/f_perms.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/*
* Copyright (c) 2013 Clément Bœsch
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -34,6 +36,7 @@ enum mode {
typedef struct {
const AVClass *class;
AVLFG lfg;
int64_t random_seed;
enum mode mode;
} PermsContext;

@@ -47,16 +50,23 @@ static const AVOption options[] = {
{ "rw", "set all output frames writable", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_RW}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "toggle", "switch permissions", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_TOGGLE}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "random", "set permissions randomly", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_RANDOM}, INT_MIN, INT_MAX, FLAGS, "mode" },
{ "seed", "set the seed for the random mode", OFFSET(random_seed), AV_OPT_TYPE_INT64, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
{ NULL }
};

static av_cold int init(AVFilterContext *ctx, const char *args, const AVClass *class)
static av_cold int init(AVFilterContext *ctx, const char *args)
{
PermsContext *perms = ctx->priv;

// TODO: add a seed option
if (perms->mode == MODE_RANDOM)
av_lfg_init(&perms->lfg, av_get_random_seed());
if (perms->mode == MODE_RANDOM) {
uint32_t seed;

if (perms->random_seed == -1)
perms->random_seed = av_get_random_seed();
seed = perms->random_seed;
av_log(ctx, AV_LOG_INFO, "random seed: 0x%08x\n", seed);
av_lfg_init(&perms->lfg, seed);
}

return 0;
}
@@ -108,11 +118,6 @@ static const char *const shorthand[] = { "mode", NULL };
#define aperms_options options
AVFILTER_DEFINE_CLASS(aperms);

static av_cold int aperms_init(AVFilterContext *ctx, const char *args)
{
return init(ctx, args, &aperms_class);
}

static const AVFilterPad aperms_inputs[] = {
{
.name = "default",
@@ -133,7 +138,7 @@ static const AVFilterPad aperms_outputs[] = {
AVFilter avfilter_af_aperms = {
.name = "aperms",
.description = NULL_IF_CONFIG_SMALL("Set permissions for the output audio frame."),
.init = aperms_init,
.init = init,
.priv_size = sizeof(PermsContext),
.inputs = aperms_inputs,
.outputs = aperms_outputs,
@@ -147,11 +152,6 @@ AVFilter avfilter_af_aperms = {
#define perms_options options
AVFILTER_DEFINE_CLASS(perms);

static av_cold int perms_init(AVFilterContext *ctx, const char *args)
{
return init(ctx, args, &perms_class);
}

static const AVFilterPad perms_inputs[] = {
{
.name = "default",
@@ -172,7 +172,7 @@ static const AVFilterPad perms_outputs[] = {
AVFilter avfilter_vf_perms = {
.name = "perms",
.description = NULL_IF_CONFIG_SMALL("Set permissions for the output video frame."),
.init = perms_init,
.init = init,
.priv_size = sizeof(PermsContext),
.inputs = perms_inputs,
.outputs = perms_outputs,
2 changes: 1 addition & 1 deletion libavfilter/version.h
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@

#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 48
#define LIBAVFILTER_VERSION_MICRO 104
#define LIBAVFILTER_VERSION_MICRO 105

#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \